package com.msoe.client.panels;

import com.msoe.client.Session;

/**
 * creates panels with specified
 * name and session
 * @author finleyb
 *
 */
public class PanelFactory {

	/**
	 * private constructor for static class
	 */
	private PanelFactory(){

	}

	/**
	 * create a panel with the given name and session
	 * @param name
	 * @param session
	 * @return a panel with the given name and session
	 */
	public static MSOERPanel createPanelWithSession(String name,Session session){

		MSOERPanel createdPanel = null;

		if(name.equals("AddRide")){
			createdPanel = new AddRide(session);
		}
		else if(name.equals("GetRide")){
			createdPanel = new GetRide(session);
		}
		else if(name.equals("Login")){
			createdPanel = new Login(session);
		}
		else if(name.equals("Register")){
			createdPanel = new Register(session);
		}
		else if(name.equals("UserHome")){
			createdPanel = new UserHome(session);
		}
		else if(name.equals("AccountSettings")){
			createdPanel = new AccountSettings(session);
		}
		//default create a login panel
		else{
			createdPanel = new Login(session);
		}

		return createdPanel;
	}

}
